\(\int \frac {c-c \sec (e+f x)}{(a+a \sec (e+f x))^{3/2}} \, dx\) [75]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F(-2)]
   Mupad [F(-1)]

Optimal result

Integrand size = 26, antiderivative size = 113 \[ \int \frac {c-c \sec (e+f x)}{(a+a \sec (e+f x))^{3/2}} \, dx=\frac {2 c \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{a^{3/2} f}-\frac {3 c \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a+a \sec (e+f x)}}\right )}{\sqrt {2} a^{3/2} f}-\frac {c \tan (e+f x)}{f (a+a \sec (e+f x))^{3/2}} \]

[Out]

2*c*arctan(a^(1/2)*tan(f*x+e)/(a+a*sec(f*x+e))^(1/2))/a^(3/2)/f-3/2*c*arctan(1/2*a^(1/2)*tan(f*x+e)*2^(1/2)/(a
+a*sec(f*x+e))^(1/2))/a^(3/2)/f*2^(1/2)-c*tan(f*x+e)/f/(a+a*sec(f*x+e))^(3/2)

Rubi [A] (verified)

Time = 0.21 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.15, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {3989, 3972, 482, 536, 209} \[ \int \frac {c-c \sec (e+f x)}{(a+a \sec (e+f x))^{3/2}} \, dx=\frac {2 c \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a \sec (e+f x)+a}}\right )}{a^{3/2} f}-\frac {3 c \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a \sec (e+f x)+a}}\right )}{\sqrt {2} a^{3/2} f}-\frac {c \sin (e+f x) \sec ^2\left (\frac {1}{2} (e+f x)\right )}{2 a f \sqrt {a \sec (e+f x)+a}} \]

[In]

Int[(c - c*Sec[e + f*x])/(a + a*Sec[e + f*x])^(3/2),x]

[Out]

(2*c*ArcTan[(Sqrt[a]*Tan[e + f*x])/Sqrt[a + a*Sec[e + f*x]]])/(a^(3/2)*f) - (3*c*ArcTan[(Sqrt[a]*Tan[e + f*x])
/(Sqrt[2]*Sqrt[a + a*Sec[e + f*x]])])/(Sqrt[2]*a^(3/2)*f) - (c*Sec[(e + f*x)/2]^2*Sin[e + f*x])/(2*a*f*Sqrt[a
+ a*Sec[e + f*x]])

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 482

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[e^(n - 1
)*(e*x)^(m - n + 1)*(a + b*x^n)^(p + 1)*((c + d*x^n)^(q + 1)/(n*(b*c - a*d)*(p + 1))), x] - Dist[e^n/(n*(b*c -
 a*d)*(p + 1)), Int[(e*x)^(m - n)*(a + b*x^n)^(p + 1)*(c + d*x^n)^q*Simp[c*(m - n + 1) + d*(m + n*(p + q + 1)
+ 1)*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, q}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LtQ[p, -1] && GeQ[n
, m - n + 1] && GtQ[m - n + 1, 0] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]

Rule 536

Int[((e_) + (f_.)*(x_)^(n_))/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[(b*e - a*f
)/(b*c - a*d), Int[1/(a + b*x^n), x], x] - Dist[(d*e - c*f)/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a
, b, c, d, e, f, n}, x]

Rule 3972

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_.), x_Symbol] :> Dist[-2*(a^(m/2 +
 n + 1/2)/d), Subst[Int[x^m*((2 + a*x^2)^(m/2 + n - 1/2)/(1 + a*x^2)), x], x, Cot[c + d*x]/Sqrt[a + b*Csc[c +
d*x]]], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0] && IntegerQ[m/2] && IntegerQ[n - 1/2]

Rule 3989

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_.), x_Symbol] :> Di
st[((-a)*c)^m, Int[Cot[e + f*x]^(2*m)*(c + d*Csc[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x]
&& EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IntegerQ[m] && RationalQ[n] &&  !(IntegerQ[n] && GtQ[m - n, 0])

Rubi steps \begin{align*} \text {integral}& = -\left ((a c) \int \frac {\tan ^2(e+f x)}{(a+a \sec (e+f x))^{5/2}} \, dx\right ) \\ & = \frac {(2 c) \text {Subst}\left (\int \frac {x^2}{\left (1+a x^2\right ) \left (2+a x^2\right )^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f} \\ & = -\frac {c \sec ^2\left (\frac {1}{2} (e+f x)\right ) \sin (e+f x)}{2 a f \sqrt {a+a \sec (e+f x)}}-\frac {c \text {Subst}\left (\int \frac {1-a x^2}{\left (1+a x^2\right ) \left (2+a x^2\right )} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{a f} \\ & = -\frac {c \sec ^2\left (\frac {1}{2} (e+f x)\right ) \sin (e+f x)}{2 a f \sqrt {a+a \sec (e+f x)}}-\frac {(2 c) \text {Subst}\left (\int \frac {1}{1+a x^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{a f}+\frac {(3 c) \text {Subst}\left (\int \frac {1}{2+a x^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{a f} \\ & = \frac {2 c \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{a^{3/2} f}-\frac {3 c \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a+a \sec (e+f x)}}\right )}{\sqrt {2} a^{3/2} f}-\frac {c \sec ^2\left (\frac {1}{2} (e+f x)\right ) \sin (e+f x)}{2 a f \sqrt {a+a \sec (e+f x)}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.64 (sec) , antiderivative size = 145, normalized size of antiderivative = 1.28 \[ \int \frac {c-c \sec (e+f x)}{(a+a \sec (e+f x))^{3/2}} \, dx=\frac {\left (4 c^{3/2} \text {arctanh}\left (\frac {\sqrt {c-c \sec (e+f x)}}{\sqrt {c}}\right ) (1+\sec (e+f x))-3 \sqrt {2} c^{3/2} \text {arctanh}\left (\frac {\sqrt {c-c \sec (e+f x)}}{\sqrt {2} \sqrt {c}}\right ) (1+\sec (e+f x))-2 c \sqrt {c-c \sec (e+f x)}\right ) \tan (e+f x)}{2 f (a (1+\sec (e+f x)))^{3/2} \sqrt {c-c \sec (e+f x)}} \]

[In]

Integrate[(c - c*Sec[e + f*x])/(a + a*Sec[e + f*x])^(3/2),x]

[Out]

((4*c^(3/2)*ArcTanh[Sqrt[c - c*Sec[e + f*x]]/Sqrt[c]]*(1 + Sec[e + f*x]) - 3*Sqrt[2]*c^(3/2)*ArcTanh[Sqrt[c -
c*Sec[e + f*x]]/(Sqrt[2]*Sqrt[c])]*(1 + Sec[e + f*x]) - 2*c*Sqrt[c - c*Sec[e + f*x]])*Tan[e + f*x])/(2*f*(a*(1
 + Sec[e + f*x]))^(3/2)*Sqrt[c - c*Sec[e + f*x]])

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(200\) vs. \(2(96)=192\).

Time = 2.43 (sec) , antiderivative size = 201, normalized size of antiderivative = 1.78

method result size
default \(-\frac {c \sqrt {-\frac {2 a}{\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}}\, \sqrt {\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}\, \left (-2 \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {2}\, \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )\right )}{\sqrt {\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}}\right )-\sqrt {\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}\, \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )\right )+3 \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}\right )\right )}{2 a^{2} f}\) \(201\)
parts \(\frac {c \sqrt {-\frac {2 a}{\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}}\, \sqrt {\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}\, \left (4 \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {2}\, \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )\right )}{\sqrt {\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}}\right )+\sqrt {\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}\, \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )\right )-5 \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}\right )\right )}{4 f \,a^{2}}-\frac {c \sqrt {-\frac {2 a}{\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}}\, \sqrt {\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}\, \left (-\sqrt {\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}\, \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )\right )+\ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}\right )\right )}{4 f \,a^{2}}\) \(349\)

[In]

int((c-c*sec(f*x+e))/(a+a*sec(f*x+e))^(3/2),x,method=_RETURNVERBOSE)

[Out]

-1/2*c/a^2/f*(-2*a/((1-cos(f*x+e))^2*csc(f*x+e)^2-1))^(1/2)*((1-cos(f*x+e))^2*csc(f*x+e)^2-1)^(1/2)*(-2*2^(1/2
)*arctanh(2^(1/2)/((1-cos(f*x+e))^2*csc(f*x+e)^2-1)^(1/2)*(-cot(f*x+e)+csc(f*x+e)))-((1-cos(f*x+e))^2*csc(f*x+
e)^2-1)^(1/2)*(-cot(f*x+e)+csc(f*x+e))+3*ln(csc(f*x+e)-cot(f*x+e)+((1-cos(f*x+e))^2*csc(f*x+e)^2-1)^(1/2)))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 210 vs. \(2 (96) = 192\).

Time = 0.39 (sec) , antiderivative size = 505, normalized size of antiderivative = 4.47 \[ \int \frac {c-c \sec (e+f x)}{(a+a \sec (e+f x))^{3/2}} \, dx=\left [-\frac {4 \, c \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + 3 \, \sqrt {2} {\left (c \cos \left (f x + e\right )^{2} + 2 \, c \cos \left (f x + e\right ) + c\right )} \sqrt {-a} \log \left (-\frac {2 \, \sqrt {2} \sqrt {-a} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) - 3 \, a \cos \left (f x + e\right )^{2} - 2 \, a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) + 1}\right ) + 4 \, {\left (c \cos \left (f x + e\right )^{2} + 2 \, c \cos \left (f x + e\right ) + c\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (f x + e\right )^{2} + 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right ) + 1}\right )}{4 \, {\left (a^{2} f \cos \left (f x + e\right )^{2} + 2 \, a^{2} f \cos \left (f x + e\right ) + a^{2} f\right )}}, -\frac {2 \, c \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) - 3 \, \sqrt {2} {\left (c \cos \left (f x + e\right )^{2} + 2 \, c \cos \left (f x + e\right ) + c\right )} \sqrt {a} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right ) + 4 \, {\left (c \cos \left (f x + e\right )^{2} + 2 \, c \cos \left (f x + e\right ) + c\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right )}{2 \, {\left (a^{2} f \cos \left (f x + e\right )^{2} + 2 \, a^{2} f \cos \left (f x + e\right ) + a^{2} f\right )}}\right ] \]

[In]

integrate((c-c*sec(f*x+e))/(a+a*sec(f*x+e))^(3/2),x, algorithm="fricas")

[Out]

[-1/4*(4*c*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*cos(f*x + e)*sin(f*x + e) + 3*sqrt(2)*(c*cos(f*x + e)^2 + 2
*c*cos(f*x + e) + c)*sqrt(-a)*log(-(2*sqrt(2)*sqrt(-a)*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*cos(f*x + e)*si
n(f*x + e) - 3*a*cos(f*x + e)^2 - 2*a*cos(f*x + e) + a)/(cos(f*x + e)^2 + 2*cos(f*x + e) + 1)) + 4*(c*cos(f*x
+ e)^2 + 2*c*cos(f*x + e) + c)*sqrt(-a)*log((2*a*cos(f*x + e)^2 + 2*sqrt(-a)*sqrt((a*cos(f*x + e) + a)/cos(f*x
 + e))*cos(f*x + e)*sin(f*x + e) + a*cos(f*x + e) - a)/(cos(f*x + e) + 1)))/(a^2*f*cos(f*x + e)^2 + 2*a^2*f*co
s(f*x + e) + a^2*f), -1/2*(2*c*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*cos(f*x + e)*sin(f*x + e) - 3*sqrt(2)*(
c*cos(f*x + e)^2 + 2*c*cos(f*x + e) + c)*sqrt(a)*arctan(sqrt(2)*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*cos(f*
x + e)/(sqrt(a)*sin(f*x + e))) + 4*(c*cos(f*x + e)^2 + 2*c*cos(f*x + e) + c)*sqrt(a)*arctan(sqrt((a*cos(f*x +
e) + a)/cos(f*x + e))*cos(f*x + e)/(sqrt(a)*sin(f*x + e))))/(a^2*f*cos(f*x + e)^2 + 2*a^2*f*cos(f*x + e) + a^2
*f)]

Sympy [F]

\[ \int \frac {c-c \sec (e+f x)}{(a+a \sec (e+f x))^{3/2}} \, dx=- c \left (\int \frac {\sec {\left (e + f x \right )}}{a \sqrt {a \sec {\left (e + f x \right )} + a} \sec {\left (e + f x \right )} + a \sqrt {a \sec {\left (e + f x \right )} + a}}\, dx + \int \left (- \frac {1}{a \sqrt {a \sec {\left (e + f x \right )} + a} \sec {\left (e + f x \right )} + a \sqrt {a \sec {\left (e + f x \right )} + a}}\right )\, dx\right ) \]

[In]

integrate((c-c*sec(f*x+e))/(a+a*sec(f*x+e))**(3/2),x)

[Out]

-c*(Integral(sec(e + f*x)/(a*sqrt(a*sec(e + f*x) + a)*sec(e + f*x) + a*sqrt(a*sec(e + f*x) + a)), x) + Integra
l(-1/(a*sqrt(a*sec(e + f*x) + a)*sec(e + f*x) + a*sqrt(a*sec(e + f*x) + a)), x))

Maxima [F]

\[ \int \frac {c-c \sec (e+f x)}{(a+a \sec (e+f x))^{3/2}} \, dx=\int { -\frac {c \sec \left (f x + e\right ) - c}{{\left (a \sec \left (f x + e\right ) + a\right )}^{\frac {3}{2}}} \,d x } \]

[In]

integrate((c-c*sec(f*x+e))/(a+a*sec(f*x+e))^(3/2),x, algorithm="maxima")

[Out]

-integrate((c*sec(f*x + e) - c)/(a*sec(f*x + e) + a)^(3/2), x)

Giac [F(-2)]

Exception generated. \[ \int \frac {c-c \sec (e+f x)}{(a+a \sec (e+f x))^{3/2}} \, dx=\text {Exception raised: TypeError} \]

[In]

integrate((c-c*sec(f*x+e))/(a+a*sec(f*x+e))^(3/2),x, algorithm="giac")

[Out]

Exception raised: TypeError >> an error occurred running a Giac command:INPUT:sage2:=int(sage0,sageVARx):;OUTP
UT:index.cc index_m i_lex_is_greater Error: Bad Argument Value

Mupad [F(-1)]

Timed out. \[ \int \frac {c-c \sec (e+f x)}{(a+a \sec (e+f x))^{3/2}} \, dx=\int \frac {c-\frac {c}{\cos \left (e+f\,x\right )}}{{\left (a+\frac {a}{\cos \left (e+f\,x\right )}\right )}^{3/2}} \,d x \]

[In]

int((c - c/cos(e + f*x))/(a + a/cos(e + f*x))^(3/2),x)

[Out]

int((c - c/cos(e + f*x))/(a + a/cos(e + f*x))^(3/2), x)